@import './var.css';

// Scrollbar stability
html {
  scrollbar-gutter: stable;

  @supports not (scrollbar-gutter: stable) {
    overflow-y: scroll;
  }
}

// Theme-specific body styles
[data-bs-theme='dark'] body {
  backdrop-filter: brightness(0.6);
}

body {
  min-height: 100vh;
  font-family: var(--font-family-base);
  background-color: #5496dd;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  backdrop-filter: brightness(0.85);
  transition: background 0.3s ease;

  &[data-bs-theme='dark'] {
    backdrop-filter: brightness(0.6);
  }
}

// Theme variables
[data-bs-theme='light'] {
  --bs-body-bg: rgba(255, 255, 255, 0.41);
  --bs-dropdown-bg: rgba(255, 255, 255, 0.7);
}

[data-bs-theme='dark'] {
  --bs-body-bg: rgba(0, 0, 0, 0.65);
  --bs-dropdown-bg: rgba(0, 0, 0, 0.7);
}

// Drag and drop indicator
.dragover {
  outline: 4px dashed #ffc400;
  outline-offset: -20px;
}

// Layout
.container {
  padding: 1rem;
}

// Page typography
.page-title {
  font-size: 1.9rem;
  font-weight: 100;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  color: var(--text-title-color, #333);
  transition: color 0.5s ease;

  [data-bs-theme='dark'] &,
  [data-bs-theme='light'] &,
  body.bg-dark &,
  body.bg-light & {
    color: var(--text-title-color) !important;
  }
}

.page-subtitle {
  font-size: 1rem;
  font-weight: 100;
  margin-bottom: 0;
  color: var(--text-primary-color, #fff);
  transition: color 0.5s ease;
}

// Color transition utility
:root.text-color-transitioning * {
  transition: color 0.5s ease !important;
}

// Card component - shared backdrop styles
@card-backdrop-base: {
  transform: translateZ(0);
  backface-visibility: hidden;
};

.card {
  border: none;
  border-radius: 12px;

  &-header,
  &-body {
    @card-backdrop-base();
  }

  &-header {
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
    backdrop-filter: blur(4px) saturate(1.8);
  }

  &-title {
    font-size: 1.1rem;
    font-weight: 600;
  }

  &-body {
    padding: 1.25rem;
    backdrop-filter: blur(2px) saturate(1.8);

    p {
      font-size: 0.9rem;
      line-height: 1.6;

      &.pre-line {
        white-space: pre-line;
      }
    }
  }

  [data-bs-theme='dark'] & {
    &-header {
      backdrop-filter: blur(2px);
    }

    &-body {
      backdrop-filter: none;
    }
  }
}